//
//  MallHomeContentDataModel.m
//  Yanwei
//
//  Created by weijunjie on 2018/11/16.
//  Copyright © 2018年 DCloud. All rights reserved.
//

#import "MallHomeContentDataModel.h"
@interface MallHomeContentDataModel()

@end
@implementation MallHomeContentDataModel
static CGFloat _twoGoodsPerLine = 0;
static CGFloat _threeGoodsPerLine = 0;
static CGFloat _moreGoodsPerLine = 0;


+ (CGFloat)twoGoodsPerLineHeight {
    if (_twoGoodsPerLine != 0) {
        return _twoGoodsPerLine;
    }
    
    CGFloat h = (ScreenWidth - 35) * 0.5; // 图片高度
    h += 10; // 图片与文字间隙
    h += [@"商品名" boundingRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : APPFONT(14)} context:nil].size.height * 2 + 3; // 文字高度
    h += [@"58" boundingRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : APPBOLDPINGFANGFONT(18)} context:nil].size.height; // 价格高度
    // 划线价高度
    h += [@"市场均价" boundingRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : APPFONT(10)} context:nil].size.height;
    h += 10; // 底部间距
    _twoGoodsPerLine = h;
    return h;
}

//+ (CGFloat)threeGoodsPerLineHeight {
//    if (_threeGoodsPerLine != 0) {
//        return _threeGoodsPerLine;
//    }
//    CGFloat h = 112.0 / 375.0 * ScreenWidth; // 图片高度
//    h += 5; // 图片与文字间隙
//    h += [@"商品名" boundingRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : APPFONT(12)} context:nil].size.height * 2 + 2; // 文字高度
//    h += [@"58" boundingRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : APPBOLDPINGFANGFONT(17)} context:nil].size.height; // 价格高度
//    h += [@"市场均价" boundingRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : APPFONT(10)} context:nil].size.height; // 划线价高度
//    h += 10; // 底部间距
//    _threeGoodsPerLine = h;
//    return h;
//}
//
//+ (CGFloat)moreGoodsPerLineHeight {
//    if (_moreGoodsPerLine != 0) {
//        return _moreGoodsPerLine;
//    }
//    CGFloat h = 107; // 图片高度
//    h += 26; // 图片与文字间隙
//    h += [@"商品名" boundingRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : APPFONT(12)} context:nil].size.height * 2 + 2; // 文字高度
//    h += [@"58" boundingRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : APPBOLDPINGFANGFONT(12)} context:nil].size.height; // 价格高度
//    h += [@"市场均价¥265" boundingRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : APPFONT(10)} context:nil].size.height + 3; // 价格高度
//    h += 7; // 底部高度
//    _moreGoodsPerLine = h;
//    return _moreGoodsPerLine;
//}

@end
